//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Collections.Generic;
using OpenLS.Core.Serialization;

namespace OpenLS.Spreadsheet
{
    static class Extension
    {
        public static IEnumerable<T> FindAll<T>(IEnumerable<T> e, Predicate <T>p)
        {
            foreach (var t in e)
            {
                if (p(t))
                    yield return t;
            }
        }
    }
    class ExtensionSerialization
    {
        public static T ReadElement<T>(ReadContext context) where T : IOfficeXmlSerializable, new()
        {
            using (var c = context.Read("ext"))
            {
                return c.ReadElement<T>();
            }
        }
    }

    
}